﻿using System.Web.Mvc;

namespace UrlAndRoutes.Controllers
{

    [RouteArea("Services")]
    [RoutePrefix("Users")]
    public class CustomerController : Controller
    {
        //
        // GET: /Customer/
        [Route("~/Test")] // attribute based routing, MVC5 support
        public ActionResult Index()
        {
            ViewBag.Controller = "Customer";
            ViewBag.Action = "Index";
            return View("ActionName");
        }

        public ActionResult List()
        {
            ViewBag.Controller = "Customer";
            ViewBag.Action = "List";
            return View("ActionName");
        }

        [Route("Add/{user}/{id:int}", Name = "AddRoute")]
        public string Create(string user, int id)
        {
            return string.Format("Create method - User {0}, Id: {1}", user, id);
        }

        [Route("Add/{user}/{password}")]
        public string ChangePass(string user, string pass)
        {
            return string.Format("ChangePass Method: User: {0}, Password: {1}", user, pass);
        }
    }
}